home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_066
/
foogol
/
test.foo
< prev
next >
Wrap
Text File
|
1992-05-06
|
547b
|
22 lines
begin
integer n, div, sub, test, testcopy, found, max;
test := 2; max := 10; /* number of primes wanted */
while n # max do begin
div:= test-1; found:= 0;
while div-1 do begin
testcopy:= test; sub:= 0;
while testcopy do begin
sub:= sub+1; if sub = div then sub:= 0;
testcopy:= testcopy-1
end;
if sub = 0 then found:= 1;
div:= div-1
end;
if found = 0 then begin
n:= n+1;
printn(test); prints(" is prime number "); printn(n); print
end;
test:= test+1
end
end